package com.ttt.tank;

import com.ttt.util.MyUtil;

import java.awt.*;

/**
 * 玩家二操控的坦克的类
 */
public class HisTank extends Tank{

    //坦克的图片数组
    private static Image[] tank2Img;
    //在静态代码块中对它初始化
    static {
        tank2Img = new Image[4];
        tank2Img[0] = MyUtil.createImage("images/tank2up.png");
        tank2Img[1] = MyUtil.createImage("images/tank2down.png");
        tank2Img[2] = MyUtil.createImage("images/tank2left.png");
        tank2Img[3] = MyUtil.createImage("images/tank2right.png");


    }
    public HisTank(int x, int y, int dir) {
        super(x, y, dir);
    }

    @Override
    public void drawImgTank(Graphics g) {
        g.drawImage(tank2Img[getDir()],getX() - Radius,getY() - Radius,null);
    }
}
